package com.sanyue.springboot.config;

import com.sanyue.springboot.interceptor.LoginInterceptor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 第二种拦截器注册方式
 * @author: Guan
 **/
@Slf4j
@Configuration
public class WebConfig2 {
    // @Bean
    // public WebMvcConfigurer webMvcConfigurer(){
    //
    //     return new WebMvcConfigurer() {
    //         @Override
    //         public void addInterceptors(InterceptorRegistry registry) {
    //             log.info("addInterceptors~~~~");
    //             registry.addInterceptor(new LoginInterceptor())
    //                     .addPathPatterns("/**")
    //                     .excludePathPatterns("/","/login","/images/**","/upload.html","/upload");
    //
    //         }
    //     };
    // }

}
